package com.zfl.controller;

import com.zfl.vo.Result;
import com.zfl.service.LoginService;
import com.zfl.vo.LoginRequestVO;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/auth")
public class LoginController {

    private final LoginService loginService;

    public LoginController(LoginService loginService) {
        this.loginService = loginService;
    }

    @PostMapping("/login")
    public Result<?> login(@Valid @RequestBody LoginRequestVO request) {
        return loginService.login(request);
    }
}